import request from '@/utils/request'

/**
 * 获取trademark的分页列表
 * @param {*} page 当前页码
 * @param {*} limit 每页条数
 * @returns
 */
export const reqGetTrademarkList = (page, limit) => {
  return request({
    method: 'GET',
    url: `/admin/product/baseTrademark/${page}/${limit}`
  })
}

// 添加品牌
export const reqAddTrademark = (tmName, logoUrl) => {
  return request({
    method: 'POST',
    url: `/admin/product/baseTrademark/save`,
    data: {
      logoUrl,
      tmName
    }
  })
}

// 修改品牌
export const reqUpdateTrademark = ({ id, logoUrl, tmName }) => {
  return request({
    method: 'PUT',
    url: `/admin/product/baseTrademark/update`,
    data: {
      id,
      logoUrl,
      tmName
    }
  })
}

// 删除品牌
export const reqRemoveTrademark = id => {
  return request({
    method: 'DELETE',
    url: `/admin/product/baseTrademark/remove/${id}`
  })
}

// 获取所有品牌列表
export const reqGetAllTrademarkList = () => {
  return request({
    method: 'GET',
    url: `/admin/product/baseTrademark/getTrademarkList`
  })
}
